﻿using System;

namespace FoodBank.Service.Helpers
{
    public static class Calculator
    {
        public static double Percentage(double numerator, double denominator)
        {
            if (Math.Abs(denominator - default(double)) < double.Epsilon)
                throw new DivideByZeroException("Denominator cannot be 0.");

            return (numerator / denominator) * 100;
        }
    }
}